import 'package:flutter/material.dart';

///
/// ListView API :  https://api.flutter-io.cn/flutter/widgets/ListView-class.html
///
///
class DemoListView2 extends StatelessWidget {
  const DemoListView2({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'JSPang Flutter ListView Demo',
      home: Scaffold(
          appBar: AppBar(
            title: const Text('ListView widget'),
          ),
          body: Center(
            child: Container(
              height: 200.0,
              child: ListView(
                scrollDirection: Axis.horizontal,
                children: [
                  Container(
                    width: 180.0,
                    color: Colors.lightBlue,
                  ),
                  Container(
                    width: 180.0,
                    color: Colors.lightGreen,
                  ),
                  Container(
                    width: 180.0,
                    color: Colors.yellowAccent,
                  ),
                  Container(
                    width: 180.0,
                    color: Colors.purpleAccent,
                  ),
                ],
              ),
            ),
          ),
      ),
    );
  }
}
